set more off

use dataset, clear

collapse netmig* z inmig* outmig* (sum) vap2010, by(fipsstate)

reshape i fipsstate
reshape j year
reshape xi z vap
reshape xij netmig inmigrated outmigrated vap
reshape long

gen netmig2 = (inmig-outmig)/vap*1000

collapse netmig, by(z year)

#delimit;

gr tw 
	(line net year if z == 1, col(black) lpat(solid) lwid(thick))
	(line net year if z == 0, col(black) lpat(dash))
	,
		legend(off)
		plotregion(style(none))
		ylab(, angle(horiz))
		ytitle("In-migration / Out-migration")
		xtitle("Year")
		text(.99 2012.25 "Expansion states")
		text(1.02 2013.8 "Non-expansion states")
		;

#delimit cr
	
gr export "_output/figureA6.pdf", replace
gr close
